/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author alberto
 */
@Embeddable
public class RecetasinsumosPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDRECETA")
    private int idreceta;
    @Basic(optional = false)
    @NotNull
    @Column(name = "IDINSUMO")
    private int idinsumo;

    public RecetasinsumosPK() {
    }

    public RecetasinsumosPK(int idreceta, int idinsumo) {
        this.idreceta = idreceta;
        this.idinsumo = idinsumo;
    }

    public int getIdreceta() {
        return idreceta;
    }

    public void setIdreceta(int idreceta) {
        this.idreceta = idreceta;
    }

    public int getIdinsumo() {
        return idinsumo;
    }

    public void setIdinsumo(int idinsumo) {
        this.idinsumo = idinsumo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idreceta;
        hash += (int) idinsumo;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RecetasinsumosPK)) {
            return false;
        }
        RecetasinsumosPK other = (RecetasinsumosPK) object;
        if (this.idreceta != other.idreceta) {
            return false;
        }
        if (this.idinsumo != other.idinsumo) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.RecetasinsumosPK[ idreceta=" + idreceta + ", idinsumo=" + idinsumo + " ]";
    }
    
}
